package com.niit.users.pojo;

import lombok.Data;

/**
 * 管理员Pojo
 * 
 * @author DELL
 *
 */
@Data
public class TbPassenger {
    private int passengerId;
    private String passengerName;
    private String passengerPasswd;
    private String passengerPhoneNo;
    private int passengerGender;
    private String passengerIdCardNo;

    private String passengerGenderStr;

    /**
     * 获取订单状态
     * @return
     */
    public String getPassengerGenderStr() {
        // 根据状态值获取字符串描述
        TbPassengerEnum[] enums = TbPassengerEnum.values();
        for (int i = 0; i < enums.length; i++) {
            TbPassengerEnum enumTemp = enums[i];
            if (enumTemp.toString().startsWith("PASSENGERGENDER_")) {
                // 表示是状态的标识
                if (enumTemp.getStatus() == this.getPassengerGender()) {
                    this.passengerGenderStr = enumTemp.getName();
                    break;
                }
            }
        }
        return passengerGenderStr;
    }

    public void printTitle() {
        String splitStr = "\t\t";
        StringBuffer sb = new StringBuffer();
        sb.append("乘客Id").append(splitStr);
        sb.append("姓名").append(splitStr);
        sb.append("手机号").append(splitStr);
        sb.append("性别").append(splitStr);
        sb.append("身份证号").append(splitStr);
        System.out.println(sb.toString());
    }

    public void printInfo() {
        String splitStr = "\t\t";
        StringBuffer sb = new StringBuffer();
        sb.append(passengerId).append(splitStr);
        sb.append(passengerName).append(splitStr);
        sb.append(this.passengerPhoneNo).append(splitStr);
        sb.append(this.getPassengerGenderStr()).append(splitStr);
        sb.append(this.passengerIdCardNo).append(splitStr);
        System.out.println(sb.toString());
    }
    
    public void printInputTitle() {
        String splitStr = ";";
        StringBuffer sb = new StringBuffer();
        sb.append("身份证号").append(splitStr);
        sb.append("密码").append(splitStr);
        sb.append("姓名").append(splitStr);
        sb.append("手机号").append(splitStr);
        sb.append("性别").append(splitStr);
        System.out.println(sb.toString());
    }

    public void printInput() {
        String splitStr = ";";
        StringBuffer sb = new StringBuffer();
        sb.append(this.passengerIdCardNo).append(splitStr);
        sb.append("xxxx").append(splitStr);
        sb.append(passengerName).append(splitStr);
        sb.append(this.passengerPhoneNo).append(splitStr);
        sb.append(this.getPassengerGenderStr()).append(splitStr);
        System.out.println("详情信息:" + sb.toString());
    }
}
